package com.zhanghu.backendZray.strategy.notify;

import com.google.common.collect.Maps;
import com.zhanghu.backendZray.enums.NotifyTypeEnum;

import java.util.Map;

/**
 * @author ZhangDong
 * @date 2024/8/30 17:30
 */
public class NotifyFactory {
    private static final Map<NotifyTypeEnum, NotifyStrategy> NOTIFY_MAP = Maps.newHashMap();

    public static void register(NotifyTypeEnum typeEnum, NotifyStrategy notifyStrategy) {
        NOTIFY_MAP.put(typeEnum, notifyStrategy);
    }

    public static NotifyStrategy get(NotifyTypeEnum typeEnum) {
        return NOTIFY_MAP.get(typeEnum);
    }

}
